/**
 * @brief   : 
 * @version : 0.1
 * @author  : wanghuan
 * @date    : 2024.11.13
 * @copyright Copyright (c) 2024 by 神工仿真, All Rights Reserved.
 */

#pragma once
#pragma once
#include "Utility/Algebra/Matrix.h"
#include "DataStructure/Common/Out.h"
#include "DataStructure/Input/Property/ShellSecMaterialConstant.h"
#include "SGFem/Integration/ShapeFunction/Plane4NodeShpFunc.h"
#include "SGFem/Integration/ShapeFunction/Quad8NodeShpFunc.h"
#include "../Common/PublicElementExport.h"

/**
 * @brief   : 基于Timoshenko 梁函数法的厚薄通用四边形板
 * 
 * @author  : wanghuan
 * @date    : 2024.11.13
 */
class PublicElement_DECLSPEC TmQPlateCalculator
{
  public:

    /// @brief 计算和节点坐标无关的变量
    void Initialize ();
    /**
     * @brief 单元初始化，计算部分与积分点无关的数据
     * 
     * @param localCoord 
     * @param SecConstant 
     */
    void SetCoordinate (const SG::Algebra::Matrix&                  localCoord,
                        const SG::DataStructure::FEM::ShellSecMaterialConstant& SecConstant);

    /**
     * @brief   : 积分点处的 应变矩阵
     * @param   : iGauss     积分点索引
     * @param   : localCoord 单元局部坐标
     * @param   : Bs         剪切部分应变矩阵
     * @param   : Bb         弯曲部分应变矩阵
     * @param   : detj       积分点处行列式的值
     * @author  : wanghuan
     * @date    : 2024.11.07
     */
    void ComputeB (int                        iGauss,
                   const SG::Algebra::Matrix& localCoord,
                   SG::Algebra::Matrix&       Bs,
                   SG::Algebra::Matrix&       Bb,
                   SG::DataStructure::Common::Real&       detj) const;
  private:
    SG::FEMSolver::Element::Plane4NodeShpFunc m_shpFunc; ///< 形函数
    SG::FEMSolver::Element::Quad8NodeShpFunc m_shpFunc8; ///< 高阶形函数
    SG::Algebra::Matrix m_alpha;
    SG::Algebra::Matrix m_beta;
    SG::Algebra::Matrix m_Xs, m_Ys;
};